const fs = require("fs");
const path =require("path");
let basePath = "/Users/yinpeng/Desktop/0 生活/拉勾教育/作业/generator-custom/generators/app/templates/";
// let a = fs.readdirSync("./generators/app/template", (err, files) => {
//     console.log(files)
// })
// console.log(a);
let a = fs.readdirSync("/Users/yinpeng/Desktop/0 生活/拉勾教育/作业/generator-custom/generators/app/templates/");


function getAllFiles (root) {
    let result = [],
        files = fs.readdirSync(root);
    files.forEach( file => {
        var pathname = `${root}/${file}`,
            state = fs.lstatSync(pathname);
        if (state.isDirectory()) {
            result = result.concat(getAllFiles(pathname));
        } else {
            result.push(pathname);
        }
    })
    return result;
}

// let files = getAllFiles(basePath);
// files.forEach(file => {
//     let filePath = path.relative(basePath, file);
//     console.log(filePath)
// })